package cn.gok.controller;

import cn.gok.entity.Course;
import cn.gok.entity.Teacher;
import cn.gok.service.TeacherService;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Author: LKSV
 * @Description:
 * @Date:Created in 19:21 2021/7/25
 */
@RestController
public class TeacherController {
    @Resource
    private TeacherService teacherService;

    @GetMapping("/teacher/getById")
    public String selectByPrimaryKey(int id){
        Teacher teacher = teacherService.selectByPrimaryKey(id);
        System.out.println(teacher);
        return "查询成功:"+teacher;
    }

    @GetMapping("/course/getByTeacherId")
    public String selectTeacherCourse(int id){
        List<Course> courses = teacherService.selectTeacherCourse(id);
        System.out.println(courses);
        return "查询成功:"+courses;
    }
}
